From f56dbf115cd31ba6e591827388bdd3f65c86b289 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Mon, 25 Sep 2017 21:00:08 +0200 Subject: [PATCH] babl: check both source/dest bits/component in bad_idea() --- babl/babl-fish-path.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 6b2874b..2a71464 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -165,7 +165,8 @@ bad_idea (const Babl *from, const Babl *to, const Babl *format) { return 1; } - if (from->format.type[0]->bits > format->format.type[0]->bits) + if (from->format.type[0]->bits > format->format.type[0]->bits && + to->format.type[0]->bits > format->format.type[0]->bits) { /* XXX: perhaps we especially avoid going to half-float, when * going between u16 formats as well? */ -- 2.30.2